home *** CD-ROM | disk | FTP | other *** search
/ CD BIT 75 / CD BIT 75.iso / Software / ooo / f_0020 / sbasic.jar / text / sbasic / common / 03030205.xml < prev    next >
Encoding:
Extensible Markup Language  |  2003-08-01  |  6.0 KB  |  41 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>TimeSerial Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03030205"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         span.T1{
  7.                 font-weight:bold;}
  8.         </style></head><body>
  9.   
  10.   
  11.   <help:paragraphinfo state="E" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="timeserial" xmlns:help="http://openoffice.org/2000/help">
  12.   <p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="TimeSerial; function" tag="kw66520_1"/><help:link Id="66520">TimeSerial Function [Runtime]</help:link></p>
  13.   <p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Calculates a serial time value for the specified hour, minute, and second parameters that are passed as numeric value. You can then use this value to calculate the difference between times.</p>
  14.   <help:paragraphinfo state="E"/></help:to-be-embedded>
  15.   <p class="Head2"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>Syntax:</p>
  16.   <p class="Paragraph"><help:paragraphinfo state="U" number="5" xmlns:help="http://openoffice.org/2000/help"/>TimeSerial (hour, minute, second)</p>
  17.   <p class="Head2"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/>Return value:</p>
  18.   <p class="Paragraph"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/>Date</p>
  19.   <p class="Head2"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/>Parameters:</p>
  20.   <p class="Paragraph"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">hour:</span> Any integer expression that indicates the hour of the time that is used to determine the serial time value. Valid values: 0-23.</p>
  21.   <p class="Paragraph"><help:paragraphinfo state="U" number="10" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">minute:</span> Any integer expression that indicates the minute of the time that is used to determine the serial time value. In general, use values between 0 and 59. However, you can also use values that lie outside of this range, where the number of minutes influence the hour value.</p>
  22.   <p class="Paragraph"><help:paragraphinfo state="U" number="11" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">second:</span> Any integer expression that indicates the second of the time that is used to determine the serial time value. In general, you can use values between 0 and 59. However, you can also use values that lie outside of this range, where the number seconds influences the minute value.</p>
  23.   <p class="Paragraph"><help:paragraphinfo state="U" number="12" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Examples:</span></p>
  24.   <p class="Paragraph"><help:paragraphinfo state="U" number="13" xmlns:help="http://openoffice.org/2000/help"/>12, -5, 45 corresponds to 11, 55, 45</p>
  25.   <p class="Paragraph"><help:paragraphinfo state="U" number="14" xmlns:help="http://openoffice.org/2000/help"/>12, 61, 45 corresponds to 13, 2, 45</p>
  26.   <p class="Paragraph"><help:paragraphinfo state="U" number="15" xmlns:help="http://openoffice.org/2000/help"/>12, 20, -2 corresponds to 12, 19, 58</p>
  27.   <p class="Paragraph"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/>12, 20, 63 corresponds to 12, 21, 4</p>
  28.   <p class="Paragraph"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/>You can use the TimeSerial function to convert any time into a single value that you can use to calculate time differences.</p>
  29.   <p class="Paragraph"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/>The TimeSerial function returns the type Variant with VarType 7 (Date). This value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, where the serial date values are calculated as days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them.</p>
  30.   <p class="Paragraph"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/>In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions.</p>
  31.   <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="errorcode" xmlns:help="http://openoffice.org/2000/help"/></p>
  32.   <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="err5" xmlns:help="http://openoffice.org/2000/help"/></p>
  33.   <p class="Head2"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/>Example:</p>
  34.   <p class="PropText"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/>Sub ExampleTimeSerial</p>
  35.   <p class="PropText"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/>Dim dDate As Double, sDate As String</p>
  36.   <p class="PropText"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/>dDate = TimeSerial(8,30,15)</p>
  37.   <p class="PropText"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>sDate = TimeSerial(8,30,15)</p>
  38.   <p class="PropText"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>MsgBox dDate,64,"Time as a number"</p>
  39.   <p class="PropText"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/>MsgBox sDate,64,"Formatted time"</p>
  40.   <p class="PropText"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>End Sub</p>
  41.  </body></html>